		
		<h3 class="name">		
			<ol class="breadcrumb">
			  <li><a href="{{$this->Html->url('/flowsteps/operate/'.$step_id)}}">{{__($step_info['Flowstep']['name'])}}</a></li>
			  <li class="active">{{if $_GET['action']=='add'}}{{ __('Add')}} {{else}} {{ __('Edit')}} {{/if}}</li>
			</ol>		
		</h3>  


<div class="detail btline2 ">
<script>
var flow_model = '{{$flow_model}}';
var step_id = '{{$step_id}}';
var flow_data = null;
{{if $flow_data}}
flow_data = {{$flow_data}};
{{/if}}
</script>
{{if $copy}}
<div class="ui-state-highlight">
复制数据，保存时，创建一条新的数据记录。修改不影响原记录内容。
</div>
{{/if}}
<div class="tabs">
{{if $flow_action=='add'}}
<?php
echo $this->Form->create($flow_model,array(
	'url' => array('controller'=>'flowsteps', 'action' => 'operate',$step_id,'?'=>$_GET,),
	'class'=>'form-horizontal form',
));
?>
{{elseif $flow_action=='edit'}}
<?php 
echo $this->Form->create($flow_model,array(
	'class'=> 'form-horizontal form',
    'url' => array('controller'=>'flowsteps', 'action' => 'operate',$step_id,$data_id,$copy,'?'=>$_GET,),
));
?>
{{/if}}
	{{$this->Form->hidden('id')}}
{{loop $view_fields $field}}
	<?php
		if($field=='id') continue;
		$field_schema = $extschema[$field];
		$modelClass = $flow_model;
		$after = '';
		if (! empty ( $field_schema['explain'] )) {
			$after = '<span>' . $field_schema['explain'] . '</span>';
		}

		if(!in_array($field,$operate_fields)){ //可操作字段,仅查看值
			echo '<div class="form-group form-inline">
		    	<label class="col-sm-2 control-label">'.__d('i18nfield', $flow_model.'_'.$field).'</label>
		    	<div class="col-sm-9">
					'.$this->data[$flow_model][$field].'
		    	</div>
			</div>';
			continue;
		}
	?>	
	{{template flowsteps/_form_item}}	
{{/loop}}

<div role="tabpanel">

  <!-- Nav tabs -->
  <ul class="nav nav-tabs" role="tablist">
  	<?php $k = 0; ?>
  	{{loop $model_object->hasOne $modelClass $setting}}
  		<li role="presentation" {{if $k==0}}class="active"{{/if}}><a href="#HasOne{{$modelClass}}" aria-controls="HasOne{{$modelClass}}" role="tab" data-toggle="tab">{{__d('modelextend','Model_'. $modelClass)}}</a></li>
  		<?php $k++; ?>
  	{{/loop}}
  </ul>

	<div class="tab-content">
	<?php $k = 0; ?>
	{{loop $model_object->hasOne $modelClass $setting}}
		<?php $hasOneObject = loadModelObject($modelClass); $one_extschema = $hasOneObject->getExtSchema(); 
			
		?>
		<div role="tabpanel" class="tab-pane {{if $k==0}}active{{/if}}" id="HasOne{{$modelClass}}">
			{{loop $one_extschema $field $field_schema}}
			<?php  
		$after = ''; 
		if (! empty ( $field_schema['explain'] )) {
			$after = '<span>' . $field_schema['explain'] . '</span>';
		}
		?>
			{{template flowsteps/_form_item}}
			
			{{/loop}}
		</div>
		<?php $k++; ?>
	{{/loop}}
	</div>
</div>

	<div class="form-group">
		<label class="col-sm-2 control-label"></label>
		<div class="col-sm-9"><input class="btn btn-primary" type="submit" value="{{__('Submit')}}"></div>
	</div>

{{$this->Form->end()}}
</div>
</div>

{{$this->Html->css(array('bootstrap-datepicker.css'))}}
{{$this->Html->script(array('bootstrap-datepicker.js'))}}
<script type="text/javascript">
$(function(){
	$(document).on('click','.form-datepicker',function(){
		if( !$(this).data('datepicker')){
			$(this).datepicker().datepicker('show');
		}
		else{
			$(this).datepicker('show');
		}
	})
})
</script>
